﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using Model;
using MsDAL;
using System.ComponentModel;
using Components;

namespace ServiceHelper
{
   [DataObjectAttribute]
   public  partial  class Bas1a25Manager:Bas1a25Base
    {
		private static Bas1a25Manager _entity;
		
        public static Bas1a25Manager Entity
        {
            get
            {
                if (_entity == null)
                    _entity = new Bas1a25Manager();
                return _entity;
            }
        }

        #region 个人代码
        public string SaveData(Hashtable tb, string action, string usercode)
        {
            List<SqlApp> lst = new List<SqlApp>();

            Bas1a25 model = null;
            if ("A" == action)
            {
                model = new Bas1a25();
                CommonUtil.GetInstance.CopyProperties(tb, model);

                model.Muser = Context.GetAppByUserCode(usercode);

                model.Listid = Sys0a60Manager.Entity.CreateSn("bas1a25_listid", usercode);

                lst.Add(this.Add(model));
            }
            else if ("M" == action)
            {
                model = this.GetModelById(Validation.ToString(tb["listid"]));

                if (model == null) return string.Format("送货地址代码({0})可能已经被删除，请重新操作！",
                    tb["addcode"]);

                CommonUtil.GetInstance.CopyProperties(tb, model);

                lst.Add(this.Update(model));
            }

            return CommonManager.Entity.SaveData(lst);
        }

        #endregion
    }
}



